import os
print(dir(os.path))
g = os.walk(r'.')
for par_dir, _, files in g:
    for file in files:
        filepath = os.path.join(par_dir, file)
        (fn,ext)=os.path.splitext(filepath)
        if(ext==".ts"):
        	cmd="mv %s %s" % (filepath,fn+".js")
        	print(fn,ext)
        	print(cmd)
        	os.system(cmd)
        if(ext==".tsx"):
        	cmd="mv %s %s" % (filepath,fn+".js")
        	print(fn,ext)
        	print(cmd)
        	os.system(cmd)
